#include<iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main(){
    char *a;
    a=(char*)malloc(sizeof(char)*128);
    int i=0;
    for(;;i++){
        a[i]=getchar();
        if(a[i]=='\n'){
            break;
        }

    }

    for(int j=0;j<=i;j++){
            if(a[j]==' '||a[j]==','||a[j]=='.'||a[j]=='?'||a[j]=='!'){
                if(a[j+1]==' '||a[j+1]==','||a[j+1]=='.'||a[j+1]=='?'||a[j+1]=='!'){
                    continue;
                }else{
                    cout<<endl;
                continue;
                }
                }else{
        putchar(a[j]);

                }
    }
    free(a);
    return 0;
}
